package com.huawei.appgallery.packagemanager.api.bean;

import android.content.ContentValues;
import android.database.Cursor;
import android.text.TextUtils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import o.blw;
import o.bmc;
import o.bmg;
import o.cof.a;

public class InstallApkTypeProcess implements bmc<List<a>> {
    public /* synthetic */ void ˋ(ContentValues contentValues, String str, Object obj) {
        ˎ(contentValues, str, (List) obj);
    }

    public String ˊ() {
        return "TEXT";
    }

    private String ˋ(List<a> list) {
        if (list == null) {
            return null;
        }
        String[] strArr = new String[list.size()];
        for (int i = 0; i < list.size(); i++) {
            a aVar = (a) list.get(i);
            strArr[i] = aVar == null ? "" : aVar.toString();
        }
        return TextUtils.join(",", strArr);
    }

    public void ˎ(ContentValues contentValues, String str, List<a> list) {
        contentValues.put(str, ˋ(list));
    }

    public void ˎ(blw o_blw, Field field, Cursor cursor, int i) {
        Object obj = null;
        try {
            Object string = cursor.getString(i);
            List list;
            if (TextUtils.isEmpty(string)) {
                list = null;
            } else {
                list = Arrays.asList(TextUtils.split(string, ","));
            }
            if (r2 != null) {
                List arrayList = new ArrayList(r2.size());
                for (String ॱ : r2) {
                    arrayList.add(a.ॱ(ॱ));
                }
                obj = arrayList;
            }
            field.set(o_blw, obj);
        } catch (IllegalAccessException e) {
            bmg.ˊ.ˎ("InstallApkTypeProcess", "put value failed:IllegalAccessException");
        }
    }
}
